# !/usr/bin/env python
# encoding: utf-8
'''
  @author: HJW
  @license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited.
  @contact: hejunwang01@126.com
  @file: loginpage.py
  @time: 2022/7/10 0010 下午 18:33
  @desc:
  '''
from selenium import webdriver
from selenium.webdriver.common.by import By
import time as t
from ..basic.Page import BasePageObj

class LoginPage(BasePageObj):
    _user_loc = (By.ID, 'kw')
    _pwd_loc = (By.ID, 'su')

    def inp(self,input_value):
        self.input(self._user_loc,input_value)

    def btn_sear(self):
        self.click(self._pwd_loc)


    def quit(self):
        self.close()


if __name__ == '__main__':
    # 登录
    driver = webdriver.Chrome()
    url = "http://www.baidu.com"
    BasePageObj(driver).open(url)
    t.sleep(1)
    LoginPage(driver).inp("baidu")
    t.sleep(1)

    LoginPage(driver).btn_sear()
    t.sleep(1)

    LoginPage(driver).quit()



